package com.tmz.order.controller;


import jakarta.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author cloud
 */
@RestController("/order")
public class OrderController {

    @Resource
    private RestTemplate restTemplate;


    @RequestMapping("/add")
    public String add(){
        System.out.println("下单成功!");
        String msg = restTemplate.getForObject("http://localhost:8011/stock/reduct", String.class);
        return "Hello World"+msg;
    }

}
